import PySide6
from PySide6 import QtWidgets


class A(object):
    pass


class B(A):
    pass


class C(A):
    pass


def get_sub_classes(class_):
    """递归地显示某一类的所有子类"""
    for subclass in class_.__subclasses__():
        print(subclass.__name__)
        if len(subclass.__subclasses__()) > 0:
            get_sub_classes(subclass)


if __name__ == '__main__':
    # 查看QAbstractButton抽象基类的所有子类，了解Qt6提供了哪些按钮控件
    get_sub_classes(PySide6.QtWidgets.QAbstractButton)
    get_sub_classes(A)
